home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1999 January - Disc 2 / Macworld (1999-01) (Disk 2).dmg / Serious Demos / Symbolic Composer 4.2 / Environment / System / SYMBOL / Symbol Generators / Loops / gen-loop next >
Lisp/Scheme  |  1998-10-23  |  1KB  |  18 lines

  1. gen-loop loop-description symbol-pattern
  2.  
  3. Returns a new symbol pattern constructed, according to the parameter settings, from a symbol-pattern by repeating its symbols according to the loop-description. Loop- description consists of lists of operations, each of which describe one repeat area.
  4.  
  5. The operation has three parameters that are closed in parenthesis, the start-position, the end-position, and the number-of-repeats. They control the looping generator, which builds a new symbol pattern from the symbol-pattern, and appends it to the output list. If this new list has to be repeated, an optional fourth parameter repeat can be used. Rhythms in note-lengths are particularly succesful within loop definitions.
  6.  
  7. (setq rhythm '(1/16 1/8 1/16 1/16))
  8.  
  9. (setq rhythm-loop (gen-loop '(1 2 4) rhythm))
  10. --> (1/16 1/8 1/16 1/8 1/16 1/8 1/16 1/8 1/16 1/16) 
  11.  
  12. There can be multiple descriptions. Select this and visualize the results.
  13.  
  14. (gen-loop '((1 3 2 2) (2 5 2 2)) '(a b c d e f g))
  15. --> (a b c a b c a b c a b c b c d e b c d e b c d e b c d e f g)
  16.  
  17.  
  18.